package com.neusoft.springdemo.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {

	@RequestMapping("/login.do")
	public String login(String userName, String password, HttpSession session) {

		String uString = "root";
		String pString = "123456";

		if (uString.equals(userName) && pString.equals(password)) {
			session.setAttribute("login_user", userName);
			// 登录成功
			return "redirect:/admin/list.do";
		} else {

			return "redirect:/login.html";
		}

	}
}
